package com.example.integration;

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Primary;
import org.springframework.integration.ftp.session.DefaultFtpSessionFactory;

@Configuration
public class MyFtpSessionFactory {


    private static final int port = 21;


    private static final String username = "chuwenyi";


    private static final String password = "chuwenyi025!";


    private static final String host = "localhost";


    @Bean
    @Primary
    DefaultFtpSessionFactory ftpSessionFactory(){
        DefaultFtpSessionFactory ftpSessionFactory = new DefaultFtpSessionFactory();
        ftpSessionFactory.setHost(host);
        ftpSessionFactory.setPort(port);
        ftpSessionFactory.setUsername(username);
        ftpSessionFactory.setPassword(password);
        return ftpSessionFactory;
    }
}
